package com.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000122691581";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMZ3d4nUMo63/2cA/XZf9yRIlF/Kxj3W88wyW8Yy5s0tfYuxQPyyTfKjWPY9BqKjls9k/ehiA2FCAQdHlpL3cRAYgFDsXPwgKM03P6vekPHmK4FwvGb0WarbOn3Z7jXHs0GziCjJXQKqukaLS+rdHA4JiwERUd1PTVVLqIgqGYCayN4NyDEcrvt0p2vsnVtEpRl/Y95e/yf3Ur2orIx3VOXGTKQSz4vnLROGPfg0rT2/vIuc187EQbAa/j1gLN1j21hAVQ0dbCueJMKKfW6FI2ZQhK0MUoM7euLWx3Rw+f9XWsS3joJaM0Hma2ntCBO+Onl49Wi7Gox9Hf4y+crjX3AgMBAAECggEAfUOaXWvBDXL+WXmlSIFhpCrtZhmGHBrlMYrR0f+S3dhGZsCRp32QSeI4otNkkDNXxJUEsP1tI5JVARlJcMS+L9fz6L9DUJZA/C9zXBOvKKPtY1x8Tu/bY6LxlCSvqx1JdjWK9z5CMtS/ChG4oB4n8zLuRrcW5eSnAuVy/nO9hAxaewFF/5by9bhMNy8CSc63A+Zs0x7c685wcvUN7nlnNMna0Eu50Mk52jY+pAaQ98QUYqkIfebQ7bGzBLowVvlf/r/EnFYxCoy8mbMiPXsicTkqWakLHBgoer5y7zkwD7qDEgvxa1GKqW6mhKLdiINk3Sqh10fPS0HsOJnaf1+3kQKBgQDKT0NL4+xHZF3jeS2BrJIXcZakKrGk1+e5S5HYFdysA9IRB0DaLm0WqsWl/q9DNAxr8SNFHdUx7npebsTd+YFpIUk5BBGFC83RQxJngoAhJ+AlwcbhdSW6umCfgfuMZuZPZBmP6Qxs/sQAoKzvMo6ieMrvMlAob95dEzJ2hVwH7QKBgQCxqmbiV+75pFyFG1frZe0seuCYCt6MXTUJbWzrmf1r+s59ku8LzE9Mosq5fW9rqJSRXNBbPpRtXzoJr6S9q9eLihlrq4MPgJ+OCw7uVrZ1bUj3FV//rj3gJdlMOD0lZn6rol3EAv/uc8y1P65/QxixQaVSRyoOJuln7w0OjOdw8wKBgQCC3kcwHl5HyFsbvNV9Hr7aP3Ys+Bk2Axw4tvO/DlVTSJ1ouoJvIL0cfpegS2HgXRjz8mbYXPX+eL/bulfLJ41ZDlkpcsJKiFo5VePf5YEw8XSDuBgI3Bjt84ZxaEnqht3Q2XXXq++Hyj3MEiQMD25JF05e8PL9VXBIURTBqn7f+QKBgHqNd7DURVVQ6j0rEmefhI31KO3YOZGLTeV15PdT3rrYZA29CEYUJfNQLBTtkKkrvWfUJSl7rnkPggJidXocim+H0Gc0BRDxgZ5CxIblq7CutPEzfmfpMmdm1FC+Tnd5DxGny5RFGXPLzz6Lcfv5NZQ4Gyj5S+o9Ly3xeQk7av6/AoGBAJW+kMpz7Sznvs3pSiHNZPy2A9cFkGdmdujY0HxWOKMbmL539UlR6rBo250ydX/Z8duVNMU6+ZP5UGGgFurFlFMF9ntFv8amtyvCLcAb06JocrtkntO4xgWjxs9DnrvyCIDztuC1wWz9UFwuFZVq2VJ7Sfq9CdWUZx+OyIoJU2Vs";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs1XJJBd4ci2URvqp72Ygu94GxRfBE/yz+E44Zk+HKAGvaytAuhQOTGyd4dFGhlb5kNGrfhlVfNeyQsPPdiVjhLSPhiKLkFseCWsSQqOZcUNcbsfj2uBc0bzPiHXmA7FQCntKAgiy+giP/Zu3GnxyZDiaACXdsd4ubjamdmoDvu+/+KGeE4BDE8HyRZJm1nEKRH0FLUey5aWB1IoJcF0sNdm0Wz4ClJB21TXi/fiKCwuqvQ/Y1ulbA5Ukq7hUWCboDcV2XueVrYLv1gVSWqgrUqpBdHUbKRwp74S79DJefkME1HB58Km6NpBocOIczYwzfFGfttSNbxvD9KRtrW0pzwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/outstanding/groupUserServlet";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/outstanding/groupUserServlet";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

